import os, sys, poser

os.chdir( os.path.dirname(poser.AppLocation()) )
if float(poser.Version()) >= 7:
    sys.path.append(os.path.join("Runtime","Python","Poseworks","Particles3","data","24"))
else:
    sys.path.append(os.path.join("Runtime","Python","Poseworks","Particles3","data","22"))

import prt3Node
from prt3Constants import *

actor = poser.Scene().CurrentActor()
figure = poser.Scene().CurrentFigure()

if actor.IsBodyPart():
    parm = actor.Parameter(PARM_TYPE)
    if parm and (parm.Value() == PARTICLE_TYPE or parm.Value() == GROUP_TYPE):
        prt3Node.addColorByLife(actor)
else:
    poser.DialogSimple.MessageBox("No particle figure selected.")

pass
